﻿@{
    Layout = null;
}
@using OptimaJet.Workflow.Core.Model
@model OpenAuth.App.ViewModel.CommonApplyVM

<script src="/Scripts/jquery-ui.js"></script>
<link href="/Content/themes/base/jquery-ui.min.css" rel="stylesheet" />
<script src="/Scripts/kinetic-v5.1.0.min.js"></script>
<link href="/Content/workflowdesigner.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/workflowdesigner.min.js"></script>
<script src="/Scripts/designerconstants.js"></script>
<script src="/Scripts/ace.js"></script>
<script src="/Scripts/json5.js"></script>

    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <input value="@Model.Id" id="processId" class="hidden"/>
                    <input value="@Model.WorkflowName" id="schemeCode" class="hidden" />
                    <h3 class="panel-title">
                        @Model.Name
                    </h3>
                </div>

                @if (Model.Commands.Length > 0)
                {
                <div class="panel-body">
                    <span class="label label-default">下图蓝色为当前状态，你可以执行：</span>
                    @foreach (var cmd in Model.Commands)
                    {
                    if (cmd.Classifier == TransitionClassifier.Reverse)
                    {
                    <button type="button" class="btn btn-danger btn-cmd" value="@cmd.Key">@cmd.Value</button>
                    }
                    else
                    {
                    <button type="button" class="btn btn-primary btn-cmd" value="@cmd.Key">@cmd.Value</button>
                    }
                    }
                </div>
                }
               <div id="wfdesigner"></div>
            </div>
        </div>
    </div>

<script src="/BllScripts/queryString.js"></script>
<script src="/BllScripts/processDetail.js"></script>